/*
 * Copyright (c) 2007
 *	Alberto Magni, Maggioni Marcello
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */
package beans;
import javax.mail.Transport;
import javax.mail.internet.MimeMessage;
/**Mailbean stores the information of the mail that has to be sent
 * @author Alberto Magni*/
public class MailBean 
{
    private String [] recipients = null;
    private Transport transport=null;
    private MimeMessage message=null;
    private String table=null;
    private Float rate=null;
    private Float limit=null;
//------------------------------------------------------------------------------
    /**Set the recipients list.
     * @param recipients the list of the recipients of the mail*/
    public void setRecipients(String [] recipients)
    {
        this.recipients=recipients;
    }
//------------------------------------------------------------------------------
    /**Set the mail to send.
     * @param message the MIME message that has to be sent*/
    public void setMessage(MimeMessage message)
    {
        this.message=message;
    }
//------------------------------------------------------------------------------
    /**Set the table of the warnings.
     * @param table the list of the warnings found by the spam analizer*/
    public void setTable(String table)
    {
        this.table=table;
    }
//------------------------------------------------------------------------------
    /**Set the spam rate of the analized mail.
     * @param rate the level of spam of the mail*/
    public void setRate(float rate)
    {
        this.rate=rate;
    }
//------------------------------------------------------------------------------
    /**Set the limit to set the mail as spam.
     * @param limit the rate above which a mail is marked as spam*/
    public void setLimit(float limit)
    {
        this.limit=limit;
    }
//------------------------------------------------------------------------------
    /**Set the enviroment in which the mail is sent.
     * @param transport the enviroment variable in which the mail is sent*/
    public void setTransport(Transport transport)
    {
        this.transport=transport;
    }
//------------------------------------------------------------------------------
    /**Returns the message to be sent.
     * @return the MIME message that has to be sent*/
    public MimeMessage getMessage()
    {
        return message;
    }
//------------------------------------------------------------------------------
    /**Returns the recipients of the mail.
     * @return the list of the mail recipients*/
    public String [] getRecipients()
    {
        return recipients;
    }
//------------------------------------------------------------------------------
    /**Returns the enviroment in which the mail has to be sent.
     * @return the enviroment variable in which the mail is sent*/
    public Transport getTransport()
    {
        return transport;
    }
//------------------------------------------------------------------------------
    /**Returns the table of the warnings
     * @return the list of the warnings found by the spam analizer*/
    public String getTable()
    {
        return table;
    }
//------------------------------------------------------------------------------
    /**Returns the limit over which a mail is set as spam.
     * @return the rate above which a mail is marked as spam*/
    public Float getLimit()
    {
        return limit.floatValue();
    }
//------------------------------------------------------------------------------
    /**Returns the spam rate of the analized mail.
     * @return the level of spam of the mail*/
    public Float getRate()
    {
        return rate.floatValue();
    }
}
